package com.wlyuan.index.domain.source.valueobj;

import com.wlyuan.core.marker.IValued;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.var;

@AllArgsConstructor
@Getter
public class BalanceBit implements IValued<Integer> {
    private Integer value;

    private static final Integer IN = 1;
    private static final Integer OUT = 2;

    public boolean marked(Character character) {
        var bit = Character.CUSTOMER == character ? OUT : IN;
        return (bit & value) == bit;
    }
}
